package com.wmy.luckywheel.mapper;


import com.wmy.luckywheel.entity.po.Prize;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @author sian37
 */
@Mapper
public interface PrizeMapper {

    @Insert("insert into prize(name, percent, status, create_time, update_time) " +
            "values (#{name}, #{percent}, #{status}, #{createTime}, #{updateTime})")
    void insert(Prize prize);

    void update(Prize prize);

    @Delete("update prize set status = 0 where id = #{id}")
        void delete(Integer id);

    @Select("select * from prize where status != 0")
    List<Prize> queryList();


    @Select("select * from prize where status = 1")
    List<Prize> queryListAndStart();
}
